﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;


namespace Phones.Models
{
    public class TreeElement
    {
        [Key]
        public int ID { get; set; }

        public string Name { get; set; }

        public string Comment { get; set; }

        public int? ParentID { get; private set; }
        [ForeignKey("ParentID")]
        public virtual TreeElement Parent { get; set; }

        public virtual ICollection<TreeElement> Children { get; set; }

        //public virtual ICollection<Contact> Contact { get; set; }

        //public int? ElementTypeID { get; set; }
        //[ForeignKey("ElementTypeID")]
        //public virtual ElementType ElementType { get; set; }

        //public int Priority { get; set; }

        //public string ShortName { get; set; }
    }
}
